package com.itheima.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.mapper.OmsOrderItemMapper;
import com.itheima.pojo.OmsOrderItem;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class OmsOrderItemImpl implements OmsOrderItemApi{
    @Autowired
    private OmsOrderItemMapper omsOrderItemMapper;
    /**
     * 根据订单id 查询到订单的商品信息
     * @param id
     * @return
     */
    @Override
    public List<OmsOrderItem> findByOrderId(Integer id) {

        LambdaQueryWrapper<OmsOrderItem> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(OmsOrderItem::getOrderId,id);
        return omsOrderItemMapper.selectList(wrapper);
    }
}
